#include <iostream>
#include <vector>

using std::vector;
using std::cout;
using std::endl;

template <typename Container>
void display(Container & con)
{
    for(auto &ele:con)
    {
        cout << ele << " ";
    }
    cout <<endl;
}

template <typename Container>
void mysize(Container & con)
{
    cout << "size() = " << con.size() << endl;
    cout << "capacity() = " << con.capacity() << endl;
    cout << endl;
}

void test(){

    vector<int> number = {1,2,3,4,5,6,7,8,9};

    display(number);
    mysize(number);

    //number.push_back(2004);
    number.push_back(128);

    display(number);
    mysize(number);

    number.pop_back();

    display(number);
    mysize(number);

    auto it = number.end();
    number.insert(it,10);
    cout << "*it = "<< *it <<endl;
    display(number);
    mysize(number);

    it = number.begin();
    number.insert(it,8,88);
    cout << "*it = "<< *it <<endl;
    display(number);
    mysize(number);

    it = number.begin();
    number.insert(it,{2004,128});
    display(number);
    mysize(number);

    it = number.begin();
    vector<int> vec = {11,22,33,44,55,66,77,88,99};
    number.insert(it,vec.begin(),vec.end());
    display(number);
}

int main()
{
    test();
    return 0;
}
